/*    */ package com.zimbra.cs.stats;
/*    */ 
/*    */ import com.zimbra.common.stats.RealtimeStatsCallback;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.PermissionCache;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import com.zimbra.cs.mailbox.MessageCache;
/*    */ import com.zimbra.cs.store.BlobInputStream;
/*    */ import com.zimbra.cs.store.FileDescriptorCache;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ServerStatsCallback
/*    */   implements RealtimeStatsCallback
/*    */ {
/*    */   public Map<String, Object> getStatData()
/*    */   {
/* 35 */     Map<String, Object> data = new HashMap();
/* 36 */     data.put("mbox_cache_size", Integer.valueOf(ZimbraPerf.getMailboxCacheSize()));
/* 37 */     data.put("msg_cache_size", Integer.valueOf(MessageCache.getSize()));
/*    */     
/* 39 */     FileDescriptorCache fdc = BlobInputStream.getFileDescriptorCache();
/* 40 */     data.put("fd_cache_size", Integer.valueOf(fdc.getSize()));
/* 41 */     data.put("fd_cache_hit_rate", Double.valueOf(fdc.getHitRate()));
/*    */     
/* 43 */     data.put("acl_cache_hit_rate", Double.valueOf(PermissionCache.getHitRate()));
/*    */     
/* 45 */     Provisioning prov = Provisioning.getInstance();
/* 46 */     if ((prov instanceof LdapProv)) {
/* 47 */       LdapProv ldap = (LdapProv)prov;
/* 48 */       data.put("account_cache_size", Integer.valueOf(ldap.getAccountCacheSize()));
/* 49 */       data.put("account_cache_hit_rate", Double.valueOf(ldap.getAccountCacheHitRate()));
/* 50 */       data.put("cos_cache_size", Integer.valueOf(ldap.getCosCacheSize()));
/* 51 */       data.put("cos_cache_hit_rate", Double.valueOf(ldap.getCosCacheHitRate()));
/* 52 */       data.put("domain_cache_size", Integer.valueOf(ldap.getDomainCacheSize()));
/* 53 */       data.put("domain_cache_hit_rate", Double.valueOf(ldap.getDomainCacheHitRate()));
/* 54 */       data.put("server_cache_size", Integer.valueOf(ldap.getServerCacheSize()));
/* 55 */       data.put("server_cache_hit_rate", Double.valueOf(ldap.getServerCacheHitRate()));
/* 56 */       data.put("ucservice_cache_size", Integer.valueOf(ldap.getUCServiceCacheSize()));
/* 57 */       data.put("ucservice_cache_hit_rate", Double.valueOf(ldap.getUCServiceCacheHitRate()));
/* 58 */       data.put("zimlet_cache_size", Integer.valueOf(ldap.getZimletCacheSize()));
/* 59 */       data.put("zimlet_cache_hit_rate", Double.valueOf(ldap.getZimletCacheHitRate()));
/* 60 */       data.put("group_cache_size", Integer.valueOf(ldap.getGroupCacheSize()));
/* 61 */       data.put("group_cache_hit_rate", Double.valueOf(ldap.getGroupCacheHitRate()));
/* 62 */       data.put("xmpp_cache_size", Integer.valueOf(ldap.getXMPPCacheSize()));
/* 63 */       data.put("xmpp_cache_hit_rate", Double.valueOf(ldap.getXMPPCacheHitRate()));
/*    */     }
/* 65 */     return data;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/stats/ServerStatsCallback.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */